import Vue from "vue";
import input from "./input.vue";
const inputConstructor = Vue.extend(input);
export default function (position, search) {
  inputConstructor.prototype.closeMask = function () {
    if (this.$el && this.$el.parentNode) {
      this.$el.parentNode.removeChild(this.$el);
    }
    this.$destroy();
  };
  const inputInstance = new inputConstructor({
    propsData: { position, search },
  });
  inputInstance.$mount();
  document.body.appendChild(inputInstance.$el);
  return inputInstance;
}
